#include "../begonia.h"
#include "boss_3_1.h"
#include "../bullet/3_1_specialbullet.h"
#include "../base/scene.h"

boss_3_1::boss_3_1():boss(192.0,250.0,20.0,0.0,0.0,&f.head)
    {
    }
boss_3_1::boss_3_1(double tx,double ty,double tr,double tvx,double tvy,bullet *h):boss(tx,ty,tr,tvx,tvy,h)
    {
    }
void boss_3_1::clone(bullet *h)
    {
        new boss_3_1(x,y,r,vx,vy,h);
    }
bool boss_3_1::move()
    {
        if((int)t/2>(int)tlast/2)
        {
            for(int i=0;i<6;i++)
            {
                double t0=M_PI*i/3+t/300;
                bullet *a=new bullet(x-cos(t0)*200.0,y-sin(t0)*200.0,5.0,cos(t0)*2.0,sin(t0)*2.0,&f.head);
                if((int)t/2%2)
                {
                    a->c_r=a->c_g=a->c_b=0.0;
                }
                else
                {
                    a->c_r=a->c_g=a->c_b=1.0;
                    a->bordered=false;
                }
            }
        }
        if(((int)t+95)/100>((int)tlast+95)/100)
        {
            double tx,ty;
            do
            {
                tx=rand()%(scw+1);
                ty=rand()%(sch+1);
            }
            while(sqr(tx-f.px)+sqr(ty-f.py)<=900.0);
            s3_1_specialbullet *a=new s3_1_specialbullet(tx,ty,10.0,0.0,0.0,&f.head);
            if((int)t/100%2) a->c_r=a->c_g=a->c_b=1.0;
            else a->c_r=a->c_g=a->c_b=0.0;
        }
        return true;
    }

